﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>客户费用详情</title>
    <!--<link href="../../script/css/bootstrap.min.css" rel="stylesheet" />
    <link href="../../script/css/bootstrap-table.css" rel="stylesheet" />
    <script src="../../script/js/jquery-1.12.3.js"></script>
    <script src="../../script/js/bootstrap.min.js"></script>
    <script src="../../script/js/bootstrap-table.js"></script>
    <script src="../../script/js/bootstrap-table-zh-CN.js"></script>
    <script src="../../script/js/cus-grid.js"></script>-->
</head>
<body>
    <div style="width:100%">
        <table name="order_account_wl"></table>
    </div>
    <script name="loadPage">
        var order_account_wl_init;

        var order_account_wl = {
        data: {
                data:[]
        },
        detailLink:[],
            rowbtns:[],
        toolbtns:[],
        cols:[],
        new: function () {
            order_account_wl_init.editLoad('../order_account_wl/order_account_wl_edit.html');
        },
        edit: function () {
            order_account_wl_init.editLoad('../order_account_wl/order_account_wl_edit.html');
        },
        del: function () {
            $.post('/api/order_account_wl/del', { id: order_account_wl_init.getId_edit }, function () {
                window.location.reload();
        });
        },
        mdel: function () {
            $.post('/api/order_account_wl/mdel', { objs: order_account_wl_init.getSelects() }, function () {
                window.location.reload();
        });
        },
        check: function () {

        },
        mcheck: function () {

        }
        };

        $(function () {
            order_account_wl.cols = [
{field: 'type',title: '类别',formatter: function (val, row, idx) {
                                            var str = '';
                                            for (var i = 0; i < order_account_wl.data['type'].length; i++) {
                                                var p = order_account_wl.data['type'][i];
                                                if (p.id == val) {
                                                    str = str == '' ? p.text : str + ',' + p.text;
                                                }
                                            }
                                            return str;
                                        }}
,{field: 'type2',title: '类型',formatter: function (val, row, idx) {
                                            var str = '';
                                            for (var i = 0; i < order_account_wl.data['type2'].length; i++) {
                                                var p = order_account_wl.data['type2'][i];
                                                if (p.id == val) {
                                                    str = str == '' ? p.text : str + ',' + p.text;
                                                }
                                            }
                                            return str;
                                        }}
,{field: 'companyid',title: '公司',formatter: function (val, row, idx) {
                                            var str = '';
                                            for (var i = 0; i < order_account_wl.data['companyid'].length; i++) {
                                                var p = order_account_wl.data['companyid'][i];
                                                if (p.id == val) {
                                                    str = str == '' ? p.text : str + ',' + p.text;
                                                }
                                            }
                                            return str;
                                        }}
,{field: 'edate',title: '日期'}
,{field: 'amount',title: '金额'}
, { field: 'preceamount', title: '提成金额', visible: false }
, { field: 'rebateamount', title: '返点金额', visible: false }
,{field: 'filler',title: '最后修改人', visible: false}
,{field: 'filldate',title: '最后修改时间', visible: false}
,{field: 'remark',title: '备注', visible: false}
//,{field: 'orderid',title: '订单', visible: false}
                ];

            order_account_wl.rowbtns.push({
                text: '编辑',
                fn: 'order_account_wl.edit'
            });
            order_account_wl.rowbtns.push({
                text: '删除',
                fn: 'order_account_wl.del'
            });
            //order_account_wl.rowbtns.push({
            //    jstr: '<button class="btn btn-danger" onclick="order_account_wl.check();">审核</button>'
            //});

            order_account_wl.toolbtns.push({
                text: '新增',
                fn: 'order_account_wl.new'
            });
            order_account_wl.toolbtns.push({
                text: '删除',
                fn: 'order_account_wl.mdel'
            });
            //order_account_wl.toolbtns.push({
            //    jstr: '<button class="btn btn-danger" onclick="order_account_wl.mcheck();">审核</button>'
            //});

            //order_account_wl.detailLink.push({
            //    tablename: 'table2',
            //    parentid: 'name',
            //    caption: 'tname',
            //    isActive: true
            //});

            order_account_wl_init = order_account_wl_init == undefined ? cusGrid() : function () {
                return order_account_wl_init.reCreate();
            }();
            $.get('/api/order_account_wl/get',
{ orderid: order_main_init.getId_detail_grid() } ,
                    function (data) {
            order_account_wl.data = data;
        order_account_wl_init.init({
            data: order_account_wl.data,
                detailLink: order_account_wl.detailLink,
                    rowbtns: order_account_wl.rowbtns,
                        toolbtns: order_account_wl.toolbtns,
                            cols: order_account_wl.cols,
                                isSelect:true,
                                tableName: 'order_account_wl'
                            });
        order_account_wl_init.initTable();
        });
        })
    </script>



</body>
</html>
